package cn.reflect;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * @author: lizemin
 * @version: 1.0
 */
public class DemoMethod {
    //这是一个main方法,是程序的入口
    public static void main(String[] args) throws IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException {
        Class<Student> studentClass = Student.class;
        Method getScore = studentClass.getDeclaredMethod("tellScore");
        Student student = studentClass.newInstance();
        Object invoke = getScore.invoke(student);
        System.out.println(invoke);



    }

}
